<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="https://cdn.bootcdn.net/ajax/libs/vue/2.6.11/vue.min.js"></script>
    <script src="https://cdn.bootcss.com/axios/0.19.2/axios.min.js"></script>
    <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.js"></script>
</head>
<body>
    <h3>save.html</h3>
    <div id="app">
        <form>
            name:<input type="text" type_name="name" v-model="name"><br>
            <button type="button" @click="add">添加</button>
        </form>
    </div>
    <script>

        let app = new Vue({
            el:"#app",
            data:{
                    name:"",
            },
            methods: {
                add() {
                    let obj = {};
                    obj.type_name = this.name
                    let json = JSON.stringify(obj);
                    let config ={
                        headers: {
                            "Content-Type":"application/json"
                        }
                    }
                    axios.post("http://localhost:8080/web/goodstype",json, config).then(function (response) {
                        console.log(response);

                    });
                }
            }
        });
    </script>
</body>
</html>